package userdao;

import javax.swing.*;
import java.awt.*;

public class LoginView extends JFrame{

    JLabel nameLabel = new JLabel("教师管理系统",JLabel.CENTER);

    SpringLayout springLayout = new SpringLayout();
    JPanel  centerPanel = new JPanel(springLayout);

    JLabel userNameLabel = new JLabel("用户名");
    JTextField userTxt = new JTextField();
    JLabel pwdLable= new JLabel("密码");
    JTextField pwdFeild =  new JTextField();
    JButton loginBtn =  new JButton("登录");
    JButton resetBtn = new JButton("重置");



    public LoginView() {
        super("登录管理");
        Container contentPane= getContentPane();
        nameLabel.setPreferredSize(new Dimension(200,30));
      //把组件加入面板
        centerPanel.add(userNameLabel);
        centerPanel.add(userTxt);
        centerPanel.add(pwdLable);
        centerPanel.add(pwdFeild);
        centerPanel.add(loginBtn);
        centerPanel.add(resetBtn);
         //放在北边
        contentPane.add(nameLabel,BorderLayout.NORTH);
        contentPane.add(centerPanel,BorderLayout.CENTER);

        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(600,500);
        setResizable(false);
        setVisible(true);
    }

    public static void main(String[] args) {
        new LoginView();
    }
}
